import { http } from "@/utils/http";

/** 发起直播 */
export const addStreaming = (params?: object) => {
  return http.request<any>("post", "/liveStreaming/addStreaming", { params });
};

/** 删除直播间 */
export const cancelLiveStreaming = (params?: object) => {
  return http.request<any>("delete", "/liveStreaming/cancelLiveStreaming", {
    params
  });
};

/** 关闭直播间 */
export const closeLiveStreamingRoom = (params?: object) => {
  return http.request<any>("get", "/liveStreaming/closeLiveStreamingRoom", {
    params
  });
};

/** 获取所有正在直播的直播 */
export const getAllLiveStreaming = () => {
  return http.request<any>("get", "/liveStreaming/getAllLiveStreaming");
};

/** 根据直播间ID获取直播间所有聊天 */
export const getLiveStreamingRoomChat = (data?: object) => {
  return http.request<any>("get", "/liveStreaming/getLiveStreamingRoomChat", {
    data
  });
};

/** 根据直播间ID获取直播间信息 */
export const getLiveStreamingRoomInfoById = (data?: object) => {
  return http.request<any>(
    "get",
    "/liveStreaming/getLiveStreamingRoomInfoById",
    {
      data
    }
  );
};

/** 根据用户id获取直播间信息 */
export const getLiveStreamingRoomInfoByUserId = (data?: object) => {
  return http.request<any>(
    "get",
    "/liveStreaming/getLiveStreamingRoomInfoByUserId",
    {
      data
    }
  );
};

/** 根据直播间ID获取直播间所有用户 */
export const getLiveStreamingRoomUser = (data?: object) => {
  return http.request<any>("get", "/liveStreaming/getLiveStreamingRoomUser", {
    data
  });
};
